﻿<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock" xmlns:ae="http://icsharpcode.net/sharpdevelop/avalonedit" xmlns:local="clr-namespace:HamsterSimulator"  mc:Ignorable="d" x:Class="HamsterSimulator.MainWindow" Title="MainWindow" Height="450" Width="900" WindowState="Maximized" WindowStyle="ThreeDBorderWindow" ResizeMode="CanResizeWithGrip" FontFamily="/HamsterSimulator;component/Fonts/#Segoe UI">
    <Window.CommandBindings>
        <CommandBinding Command="Save" CanExecute="Save_CanExecute" Executed="Save_Executed" />
        <CommandBinding Command="Open" CanExecute="Open_CanExecute" Executed="Open_Executed" />
        <CommandBinding Command="Close" CanExecute="Close_CanExecute" Executed="Close_Executed" />
    </Window.CommandBindings>
    <Window.InputBindings>
        <KeyBinding Gesture="CTRL+O" Command="Open" />
        <KeyBinding Gesture="CTRL+S" Command="Save" />
        <KeyBinding Gesture="CTRL+Z" Command="Undo" />
        <!--CommandTarget="{x:Reference Name=TextEditor}" />-->
        <KeyBinding Gesture="CTRL+Y" Command="Redo" />
        <!--CommandTarget="{x:Reference Name=TextEditor}" />-->
        <KeyBinding Gesture="ALT+F4" Command="Close" />
    </Window.InputBindings>
    <Window.Resources>
        <local:HamsterEditorViewModel x:Key="HEVM" />
    </Window.Resources>
    <Grid x:Name="WindowContent" DataContext="{DynamicResource HEVM}">
        <Grid x:Name="MainContent" IsEnabled="True">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Menu Grid.Row="0">
                <MenuItem Header="_Datei">
                    <MenuItem Header="_Speichern" Command="Save">
                        <MenuItem.Icon>
                            <Image Width="16" Height="16" VerticalAlignment="Center" HorizontalAlignment="Center" Source="/HamsterSimulator;component/Images/saveHS.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="_Öffnen..." Command="Open">
                        <MenuItem.Icon>
                            <Image Width="16" Height="16" VerticalAlignment="Center" HorizontalAlignment="Center" Source="/HamsterSimulator;component/Images/OpenFile.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <Separator />
                    <MenuItem Header="_Beenden" Command="Close" />
                    <Separator />
                    <MenuItem Header="Test">
                        <MenuItem Header="Test1" />
                        <MenuItem Header="Test2" />
                        <Separator />
                        <MenuItem Header="Test3">
                            <MenuItem Header="Test4" />
                            <MenuItem Header="Öffnen..." Command="Open" />
                        </MenuItem>
                    </MenuItem>
                </MenuItem>
            </Menu>
            <ToolBarPanel Grid.Row="1">
                <ToolBar>
                    <Button Command="Save">
                        <Image Width="16" Height="16" VerticalAlignment="Center" HorizontalAlignment="Center" Source="/HamsterSimulator;component/Images/saveHS.png" />
                    </Button>
                    <Button Command="Open">
                        <Image Width="16" Height="16" VerticalAlignment="Center" HorizontalAlignment="Center" Source="/HamsterSimulator;component/Images/OpenFile.png" />
                    </Button>
                    <Separator />
                    <Button Content="Test Text" />
                    <Button Content="Verdammter Test Text" />
                </ToolBar>
            </ToolBarPanel>
            <ad:DockingManager x:Name="dockManager" Grid.Row="2">
                <ad:ResizingPanel Orientation="Vertical">
                    <ad:ResizingPanel Orientation="Horizontal">
                        <ad:DockablePane ad:ResizingPanel.ResizeWidth="150">
                            <ad:DockableContent x:Name="classesContent" Title="Classes">
                                <TreeView>
                                    <TreeViewItem Header="Class1" />
                                    <TreeViewItem Header="Class2" />
                                </TreeView>
                            </ad:DockableContent>
                            <ad:DockableContent x:Name="toolsContent" Title="Tools">
                                <ListBox>
                                    <ListBoxItem Content="Tool1" />
                                    <ListBoxItem Content="Tool2" />
                                    <ListBoxItem Content="Tool3" />
                                </ListBox>
                            </ad:DockableContent>
                        </ad:DockablePane>
                        <ad:DocumentPane x:Name="DocumentPane" SelectedIndex="0">
                            <ad:DocumentContent x:Name="Document_1" Title="{Binding RelativeSource={RelativeSource Mode=Self},Path=Name}" IsCloseable="False">
                                <ae:TextEditor x:Name="TextEditor" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" BorderThickness="0" BorderBrush="{x:Null}" ShowLineNumbers="True" Document="{Binding Path=Document, Mode=TwoWay}" SyntaxHighlighting="C#" FontFamily="Consolas">
                                </ae:TextEditor>
                            </ad:DocumentContent>
                        </ad:DocumentPane>
                    </ad:ResizingPanel>
                    <ad:DockablePane ad:ResizingPanel.ResizeHeight="100">
                        <ad:DockableContent Title="Errors" x:Name="errorsContent">
                            <ListView>
                                <ListView.View>
                                    <GridView>
                                        <GridView.Columns>
                                            <GridViewColumn Header="Error" />
                                            <GridViewColumn Header="Page" />
                                            <GridViewColumn Header="File" />
                                            <GridViewColumn Header="Row" />
                                        </GridView.Columns>
                                    </GridView>
                                </ListView.View>
                            </ListView>
                        </ad:DockableContent>
                        <ad:DockableContent Title="Output" x:Name="output">
                            <TextBox IsReadOnly="True" AcceptsReturn="True" />
                        </ad:DockableContent>
                    </ad:DockablePane>
                </ad:ResizingPanel>
            </ad:DockingManager>
            <StatusBar Grid.Row="3" Foreground="White">
                <StatusBarItem Content="KnowHowComputer Simulator" Background="#FF293955" />
            </StatusBar>
        </Grid>
        <!--<Grid x:Name="LoadingScreen" Background="#AA000000" Cursor="Wait" d:IsHidden="True" Visibility="Collapsed">
            <StackPanel VerticalAlignment="Center">
                <TextBlock Text="Loading..." FontSize="14" VerticalAlignment="Center" Margin="0, 0, 0, 10" Foreground="White" HorizontalAlignment="Center" SnapsToDevicePixels="True" UseLayoutRounding="True" />
                <ProgressBar Height="11.5" MinWidth="160" MaxWidth="320" HorizontalAlignment="Stretch" IsIndeterminate="True" Margin="5,0" />
            </StackPanel>
        </Grid>-->
    </Grid>
</Window>
